
from tkinter import*
from tkinter import filedialog,messagebox
from tkinter.ttk import Scrollbar,Checkbutton,Label,Button
import os
import sys
class Notepad(Tk):
    def __init__(self):
        super().__init__()
        self.set_window()
        self.create_menu_bar()

    def set_window(self):
        self.title("待办事项")
        max_width,max_height=self.maxsize()
        aligh_center="800x600+%d+%d"%((max_width-800)/2,(max_height-600)/2)
        self.geometry(aligh_center)
        self.iconbitmap()
    def create_menu_bar(self):
        menu_bar = Menu(self)

        file_menu=Menu(menu_bar,tearoff=0)
        file_menu.add_command(label='新建', accelerator="Ctrl+N",command='')
        file_menu.add_command(label='打开', accelerator="Ctrl+O", command='')
        file_menu.add_command(label='保存', accelerator="Ctrl+S", command='')
        file_menu.add_command(label='另存为', accelerator="Ctrl+B", command='')
        file_menu.add_separator()
        file_menu.add_command(label='退出', accelerator="Ctrl+A", command='')

        menu_bar.add_cascade(label='文件',menu=file_menu)


        editor_menu = Menu(menu_bar, tearoff=0)
        editor_menu.add_command(label='撤销', accelerator="Ctrl+2", command='')
        editor_menu.add_separator()
        editor_menu.add_command(label='剪切', accelerator="Ctrl+4", command='')
        editor_menu.add_command(label='复制', accelerator="Ctrl+5", command='')
        editor_menu.add_command(label='粘贴', accelerator="Ctrl+6", command='')
        editor_menu.add_command(label='查找', accelerator="Ctrl+7", command='')
        editor_menu.add_separator()
        editor_menu.add_command(label='全选', accelerator="Ctrl+8", command='')

        menu_bar.add_cascade(label='编辑', menu=editor_menu)

        view_menu = Menu(menu_bar, tearoff=0)
        menu_bar.add_cascade(label='视图', menu=view_menu)
        about_menu = Menu(menu_bar, tearoff=0)
        menu_bar.add_cascade(label='视图', menu=about_menu)


        self['menu']=menu_bar
if __name__=='__main__':
    app=Notepad()
    app.mainloop()

